package 剑指offer;

/**
 * @description:
 * @author: ywk
 * @date: 2021-02-23
 */
public class 判断整型是否为回文 {
    public static void main(String[] args) {
        System.out.println(isPair(122));

    }

    public static boolean isPair(int x) {
        int temp = x;
        int tempResult = 0;
        while (temp != 0) {
            int a = temp % 10;
            tempResult = tempResult * 10 + a;
            temp = temp / 10;
        }
        if (tempResult == x) {
            return true;
        }
        return false;
    }
}
